Repository navigation
Fail early when a CKS node's user data is over vm.userdata.max.length - #14781
Open
bhouse-nexthop wants to merge 1 commit into
Open
bhouse-nexthop wants to merge 1 commit into
bhouse-nexthop wants to merge 1 commit into
Conversation
Each CKS node's rendered cloud-config is checked against vm.userdata.max.length right after base64 encoding, before the VM is deployed. | path | node type checked | fires before | |---|---|---| | create: first control node (after CNI config is appended) | control | control VM deploy | | create: additional control nodes | control | that VM's deploy | | create: etcd nodes | etcd | that VM's deploy | | create / scale: worker nodes | worker | first new worker VM deploy | | add existing VMs as nodes | worker | ISO attach, state change, any rule | - Same limit and length measure as UserDataManagerImpl uses at deploy time, so the numbers match. - The error names the node type, the cluster, the size and the limit. - logTransitStateAndThrow appends the cause's message when the cause is an InvalidParameterValueException, so the API error shows it instead of only "Provisioning the control VM failed ...". - A size failure on an etcd node moves the cluster to Error like the other node types, instead of leaving it in Starting. - Add-node renders the worker config once instead of once per node. Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14781 +/- ##
============================================
- Coverage 18.32% 18.32% -0.01%
- Complexity 16644 16650 +6
============================================
Files 5939 5939
Lines 537787 537807 +20
Branches 65932 65934 +2
============================================
- Hits 98544 98535 -9
- Misses 428033 428059 +26
- Partials 11210 11213 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR makes CKS check each node's user data against
vm.userdata.max.lengthbefore that node's VM is deployed, and fail with an error that says what's wrong.New error:
Other changes:
UserDataManagerImplat deploy time, so the numbers match.logTransitStateAndThrowappends the cause's message when the cause is anInvalidParameterValueException, so the API error shows the reason instead of onlyProvisioning the control VM failed ....Starting.Limits:
Fixes: #14780
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
KubernetesClusterActionWorkerTest: under, at and over the limit; cause message appended, not repeated, dropped for other typesKubernetesCluster*Testincloud-plugin-integrations-kubernetes-service(62 tests)How did you try to break this feature and the system with this change?
UserVmManagerImpl.createVirtualMachine→UserDataManagerImpl) to confirm CKS passes the final user data unchanged, so the pre-check can't reject anything deploy would accept.